/*
 * File:   ImageConverterTest.cpp
 * Author: Guilherme Monteiro
 *
 */

#include "ImageFormatConverterTest.h"
#include "../headers/ImageFormatConverter.h"


CPPUNIT_TEST_SUITE_REGISTRATION(ImageConverterTest);

ImageConverterTest::ImageConverterTest() {
}

ImageConverterTest::~ImageConverterTest() {
}

void ImageConverterTest::setUp() {
}

void ImageConverterTest::tearDown() {
}

void ImageConverterTest::testConvertToTiffFormat() {
    string path = "/books/caracterizacao/metadados/tabelasAlta/image278_0.png";
    TessMetaInfo* tessmetainfo = new TessMetaInfo(path);
    ImageFormatConverter* imageConverter = new ImageFormatConverter(tessmetainfo);
    imageConverter->convertToTiffFormat();
    
    string pathOut = "../books/caracterizacao/metadados/tabelasAlta/image278_0.tiff";
    IplImage* img;
    try {
        img = cvLoadImage(pathOut.c_str());
    }
    catch(exception e) {
        cerr << e.what() << endl;
    }
    
    if (img == 0) {
        CPPUNIT_ASSERT(false);
    }
}

